<?php

namespace App\Jobs;

use App\Models\DownloadJob;
use App\Models\ProjectClassify;
use App\Services\CommonService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class Test implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $table;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($table)
    {
        $this->table = $table;
    }

    /**
     * @author: lxk
     * @date: 2023/5/27 18:29
     */
    public function handle()
    {
        $table = $this->table;
        $exist = DB::table($table)->first();
        if (empty($exist)) {
            Schema::drop($table);
            info($table);
        }
    }
}
